package org.springblade.modules.admin.mapper;

import com.baomidou.mybatisplus.annotation.InterceptorIgnore;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import org.apache.ibatis.annotations.Param;
import org.springblade.modules.admin.dto.openapi.HtDaySearchCondition;
import org.springblade.modules.admin.entity.MaintainPlanUserDayCount;
import org.springblade.modules.admin.entity.MaintainSign;
import org.springblade.modules.admin.vo.MaintainSignVO;
import org.springblade.modules.admin.vo.openapi.HtUserPlanVO;

import java.math.BigDecimal;
import java.util.Date;
import java.util.List;

public interface MaintainSignMapper extends BaseMapper<MaintainSign> {
    /**
     * 自定义分页
     *
     * @param page
     * @param maintainSign
     * @return
     */
    List<MaintainSignVO> selectMaintainSignPage(IPage page, MaintainSignVO maintainSign);

	@InterceptorIgnore(tenantLine = "on")
    List<MaintainSign> selectAllNotSignOut(@Param("typeStatus") Integer typeStatus);

	@InterceptorIgnore(tenantLine = "on")
	MaintainPlanUserDayCount selectUserDaySignCount(@Param("planIds") List<Long> planIds,@Param("userIds") List<Long> userIds);

	@InterceptorIgnore(tenantLine = "on")
	BigDecimal sumPlanWorkTime(@Param("planId") Long planId);

	/**
	 * 根据工单id获取签到信息
	 * @param planIds 工单ids
	 * @return 数据集
	 */
	List<MaintainSign> getMaintainSignList(List<Long> planIds);

	/**
	 * 查询指定日期区间内，用户-保养、维修工单信息
	 */
    List<HtUserPlanVO> getHtUserPlanByTimeCondition(@Param("startDate") Date startDate, @Param("endDate") Date endDate, @Param("tenantId") String tenantId);
}
